package com.be.beadmin.system.controller.ProjectSysController;

import com.be.beadmin.common.utils.ResultModel;
import com.be.beadmin.project.dto.input.InfoDto;
import com.be.beadmin.system.service.ProjectSysService.InfoSysService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @Description:
 * @author: Jiaming Zheng
 * @Date: Create in 9:42 2023/8/31
 * @Modified By:
 **/
@Api(tags = {"项目-系统模块"})
@RestController
public class InfoSysController {

    @Autowired
    private InfoSysService infoSysService;

    @ApiOperation("删除一个项目")
    @PostMapping("/project/delInfo")
    public ResultModel delInfo(HttpServletRequest request, @RequestBody InfoDto infoDto) {
        infoSysService.delInfo(request,infoDto.getId());
        return ResultModel.success(ResultModel.DELETE);
    }


    @ApiOperation("关闭执行项目")
    @PostMapping(value = "/project/shutProject")
    public ResultModel shutProject(@RequestParam String infoId) {
        return ResultModel.success(infoSysService.shutProject(infoId));
    }
}
